greatcfandomcom-20200214-history
OpenEd-Lab8
[ C:TaPiC ] Version control using subversion Subversion consists of the following command line applications: * svn * svnadmin * svndumpfilter * svnlook >svnadmin create svn-repos >svn info file:///.../svn-repos Quick introduction using the windows command shell This introduction will use the subversion applications in the windows command shell. You will learn how to: * Create and back up a repository. * Import into a repository. Step 1. Create a repository In this step you will use the svnadmin application to create a subversion repository. You will then look at the repository using the svn client application and the structure of the repository in the file system. * Find the version of svnadmin. * Create a repository. * Look at the repository structure. * Use svn to get info about the repository. If you want to follow these examples through, enter the commands after the C:\svn-notes> command prompt in the following. * Find the version of svnadmin. C:\svn-notes>svnadmin --version svnadmin, version 1.4.0 (r21228) compiled Sep 11 2006, 17:46:59 Copyright © 2000-2006 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository back-end (FS) modules are available: * fs_base : Module for working with a Berkeley DB repository. * fs_fs : Module for working with a plain file (FSFS) repository. * Create a repository. C:\svn-notes>svnadmin create repos * Look at the repository structure. C:\svn-notes>dir repos Volume in drive C has no label. Volume Serial Number is 583C-777A Directory of C:\svn-notes\repos 02/11/2006 20:08 . 02/11/2006 20:08 .. 02/11/2006 20:08 conf 02/11/2006 20:08 dav 02/11/2006 20:08 db 02/11/2006 20:08 2 format 02/11/2006 20:08 hooks 02/11/2006 20:08 locks 02/11/2006 20:08 234 README.txt 2 File(s) 236 bytes 7 Dir(s) 25,606,332,416 bytes free * Use svn to get info about the repository. C:\svn-notes>svn info file:///c:/svn-notes/repos Path: repos URL: file:///c:/svn-notes/repos Repository Root: file:///c:/svn-notes/repos Repository UUID: 2d707b95-7f8e-fc44-91cd-d843da7b9aa4 Revision: 0 Node Kind: directory Last Changed Rev: 0 Last Changed Date: 2006-11-02 20:08:00 +0000 (Thu, 02 Nov 2006) Step 2. Back up and move a repository If you are setting up your own repository you will need to back up the repository reguarly. One way to do this is to use the svnadmin dump command. In this section you will: * Create a directory structure to import. * Import the directory structure. * Use svn info to get information about the structure. * Dump the repository. * Create a new repository. * Load the dumped file into the new repository. To keep the dump listing short we only import one revision into the repository. * Create a directory structure to import. C:\svn-notes>mkdir root C:\svn-notes>pushd root C:\svn-notes\root>mkdir trunk branches tags C:\svn-notes\root>popd * Import the directory structure. C:\svn-notes>svn import -m "Set up top level structure" root file:///c:/svn-notes/repos Adding root\trunk Adding root\branches Adding root\tags Committed revision 1. * Look at repository. C:\svn-notes>svn info file:///c:/svn-notes/repos Path: repos URL: file:///c:/svn-notes/repos Repository Root: file:///c:/svn-notes/repos Repository UUID: 207a5f12-3bea-1743-898b-e4a1ab1e329b Revision: 1 Node Kind: directory Last Changed Author: jason Last Changed Rev: 1 Last Changed Date: 2006-11-02 19:51:04 +0000 (Thu, 02 Nov 2006) * Dump the repository. C:\svn-notes>svnadmin dump repos 1>repos.dump * Look at the dump file. C:\svn-notes>type repos.dump SVN-fs-dump-format-version: 2 UUID: 207a5f12-3bea-1743-898b-e4a1ab1e329b Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2006-11-02T19:51:04.484178Z PROPS-END Revision-number: 1 Prop-content-length: 126 Content-length: 126 K 7 svn:log V 26 Set up top level structure K 10 svn:author V 5 jason K 8 svn:date V 27 2006-11-02T19:51:04.729280Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: tags Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END * Create a new repository. C:\svn-notes>svnadmin create repos-2 * Load the dump file into the new repository. C:\svn-notes>svnadmin load repos-2 0<<< Started new transaction, based on original revision 1 * adding path : branches ... done. * adding path : tags ... done. * adding path : trunk ... done. ------- Committed revision 1 >>> * Use 'svn info' to look at repos-2 C:\svn-notes>svn info file:///c:/svn-notes/repos-2 Path: repos-2 URL: file:///c:/svn-notes/repos-2 Repository Root: file:///c:/svn-notes/repos-2 Repository UUID: 207a5f12-3bea-1743-898b-e4a1ab1e329b Revision: 1 Node Kind: directory Last Changed Author: jason Last Changed Rev: 1 Last Changed Date: 2006-11-02 19:51:04 +0000 (Thu, 02 Nov 2006) Step 3. Using the repository * Check out the trunk into a working copy. * Create a directory and two files in the working copy. * Look at the status of the working copy. * Commit the new directory and files. * Edit the files. * Commit the edits. * Look at the file history. * Rename a directory. * Look at status. * Commit the directory rename. * Check out the trunk into a working copy. C:\svn-notes>mkdir work C:\svn-notes>svn checkout file:///c:/svn-notes/repos/trunk work Checked out revision 1. * Create a directory and two files in the working copy. C:\svn-notes>pushd work C:\svn-notes\work>mkdir wedding C:\svn-notes\work>echo "Service Music" 1>wedding\service.txt C:\svn-notes\work>echo "Party Music" 1>wedding\party.txt C:\svn-notes\work>svn add wedding A wedding A wedding\party.txt A wedding\service.txt * Look at the status of the working copy. C:\svn-notes\work>svn status A wedding A wedding\party.txt A wedding\service.txt C:\svn-notes\work>svn status -v 1 1 jason . A 0 ? ? wedding A 0 ? ? wedding\party.txt A 0 ? ? wedding\service.txt * Commit the new directory and files. C:\svn-notes\work>svn commit -m "Wedding music files" Adding wedding Adding wedding\party.txt Adding wedding\service.txt Transmitting file data .. Committed revision 2. * Look at the status of the working copy after commit. C:\svn-notes\work>svn status -v 1 1 jason . 2 2 jason wedding 2 2 jason wedding\party.txt 2 2 jason wedding\service.txt C:\svn-notes\work>popd Quick introduction using SuSe Linux Enterprise Desktop This introduction will use the subversion applications in the bash shell on SuSe Linux enterprise desktop. Category:OpenEd